package 每日一题;

import java.util.Arrays;

/**
 * @author 会玩的洋洋
 * https://leetcode.cn/problems/minimum-amount-of-time-to-fill-cups/
 */
public class _2335_装满杯子需要的最短总时长 {
    /**
     * 执行用时:1ms,内存消耗:39.3MB
     * @param amount
     * @return
     */
    public int fillCups(int[] amount) {
        Arrays.sort(amount);
        if (amount[2] > amount[0] + amount[1]) {
            return amount[2];
        }
        return (amount[0] + amount[1] + amount[2] + 1) / 2;
    }
}
